#pragma once

#include "Task.h"
#include "ThreadPoolSchedule.h"
#include "QueueSchedule.h"
#include "Future.h"


class WHENGINE_API CAsyncSystem
{
public:
    //if WorkThreadNum is 0, then use the number of cores-1
    static void Initialize(int64_t WorkThreadNum);
    static void Shutdown();

    static CAsyncSystem* Get();


    void DoMainThreadWork();

    QueueSchedule * MainThread;
    CThreadPoolSchedule * ThreadPool;

    static bool IsInMainThread();
protected:
    ~CAsyncSystem();
    CAsyncSystem(int64_t WorkThreadNum);

    
};